home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 43
/
Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso
/
-serious-
/
comms
/
other
/
magicfile
/
goodies
/
cleandiz.rx
next >
Wrap
Text File
|
1999-06-14
|
2KB
|
76 lines
/*
$VER: CleanDIZ 1.3 (9.4.98) ©1998 Steve Clack (with fix by Er!ny)
Looks for & removes orphan file descriptions in MAX's Pro 2, ie. if you
delete a file in the filebase its file_id.diz won't be removed - this
does that job.
Freely distributable but please credit me :o).
Requires `FSearch' to be present in `C:' (included).
Template: rx CleanDIZ.rx
----------------------------------------------------------------------------
Er!ny:
Steve's version should have in theory worked but he screwed up on
two counts >:). 1: He forgot to put the "NOPREFS" argument after the
call to flashfind, causing it to stall for about half an hour and 2:
it didn't actually nuke the dizes, as he forgot to put ".diz" after the
'line' variable i.e it WANTED to nuke "file_id.diz" but only tried to nuke
"file_id". My fixed version works 119% as it is case sensitive still :)
Steve:
NOPREFS was a nice idea, and it probably seemed as though it worked because
FlashFind is very intermittent but the problem was with FlashFind's binary
search routines & it didn't like being launched from AREXX so I changed the
searching util. Fixed the problem :). Now uses FSearch!
----------------------------------------------------------------------------
Notes: Reads `Diz:' directory & checks `BBS:Files/File.index'; if yours
is different please change below...
*/
DIZ_DIR = "Diz:"
FILE_INDEX = "BBS:Files/"
options results
options failat 99
address command
Say "CleanDIZ 1.3 ©1998 Steve Clack for MAX's Pro 2 (fix by Er!ny^Scart)"
'Copy >nil: 'FILE_INDEX'File.index RAM:'
'Copy >nil: C:FSearch RAM:'
'List >T:DIZ.TMP 'DIZ_DIR' LFORMAT="%m"'
Wait 1
Say 'Looking for orphan file descriptions, please wait...'
DELETED = 0
call open(DIZFILE,'T:DIZ.TMP',R)
do until eof(DIZFILE)
LINE = readln(DIZFILE)
if LINE ~= '' then do
'RAM:FSearch >nil: RAM:File.index "'LINE'"'
STATUS = rc
if STATUS=5 then do
'Delete >nil: 'DIZ_DIR''LINE'.diz'
DELETED = DELETED + 1
end
end
end
call close DIZFILE
'Delete >nil: RAM:FSearch'
'Delete >nil: RAM:File.index'
Say 'Operation complete. Removed 'DELETED' orphans!'
exit